/**
 * 
 */
package com.ubo.graphviz.model.graph.statement.node.classNode;

import java.util.Collection;

import com.ubo.graphviz.model.graph.statement.Attribute;
import com.ubo.graphviz.model.graph.statement.AttributeList;

/**
 * @author saludegu
 * 
 */
public abstract class AClassElement implements IClassElement {

	/**
	 * Liste des attributs de l'element.
	 */
	protected AttributeList mListAttribute;

	/**
	 * Constructor
	 * 
	 */
	public AClassElement() {
		super();
	}

	/**
	 * @see com.ubo.graphviz.model.graph.statement.node.classNode.IClassElement#addAttribute(com.ubo.graphviz.model.graph.statement.Attribute)
	 */
	@Override
	public void addAttribute(Attribute newAttribute) {
		if (mListAttribute == null)
			mListAttribute = new AttributeList();
		mListAttribute.addAttribute(newAttribute);
	}

	/**
	 * Ajout d'une collection d'attributs.
	 * 
	 * @param attributes
	 */
	public void addAllAttributes(Collection<Attribute> attributes) {
		if (mListAttribute == null)
			mListAttribute = new AttributeList();
		mListAttribute.addAllAttribute(attributes);
	}

	/**
	 * @see com.ubo.graphviz.model.graph.statement.node.classNode.IClassElement#getAttributsFromElement()
	 */
	@Override
	public AttributeList getAttributsFromElement() {
		return mListAttribute;
	}

}